package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.SourceBytecodeEvent;

public class SourceBytecodeEventImpl extends BytecodeEventImpl implements SourceBytecodeEvent
{
    private String sourceFileName;
    private String debugInformation;

    public SourceBytecodeEventImpl(final String aSourceFileName, final String aDebugInformation) {
        sourceFileName = aSourceFileName;
        debugInformation = aDebugInformation;
    }

    @Override
    public int getType() {
        return SOURCE;
    }

    @Override
    public void setSourceFileName(final String aSourceFileName) {
        sourceFileName = aSourceFileName;
    }

    @Override
    public String getSourceFileName() {
        return sourceFileName;
    }

    @Override
    public void setDebugInformation(final String aDebugInformation) {
        debugInformation = aDebugInformation;
    }

    @Override
    public String getDebugInformation() {
        return debugInformation;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeClassVisitor().visitSource(this);
        return aBytecodeVisitor;
    }
}
